#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMouseEvent>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QPaintEvent>
#include <QTimer>
#include "minet_dev.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);
    void paintEvent(QPaintEvent *event);

private slots:
    void timer1msExpire();
    void addNewNode(bool tog);
    void clrNode(bool tog);
    void startNet(bool tog);
    void stopNet(bool tog);

    void on_pushButton_clicked();
    void on_pushButtonTst_clicked();

private:
    Ui::MainWindow *ui;
    uint16_t node;
    bool isShowDist;
    QTimer *timer1ms;
    quint64 timer1msCnt;
    QList<MiNetDev*> devs;

};

#endif // MAINWINDOW_H
